(And if you have created some nice things, think about sharing them, too!)
This is a Plugin for REALbasic. Plugins contain usually low-level code that cannot be written using the REALbasic language directly.
The plugin and the sample RB program were created using CodeWarrior Pro 3 and REALbasic 1.1.1, tested on PowerPC computers running OS 8.5.
More REALbasic examples can be found on my Web Site at
<http://www.tempel.org/rb>
Enjoy!
Overview
To install, put the file TT's Icons-Plugin into the Plugins folder where your REALbasic application resides (quit REALbasic first, if it is running).
Installation
1. Quit REALbasic if it is running
2. Place the file TT's Icons-Plugin into a folder called Plugins, that resides in the same folder where your REALbasic application is.
3. Now you can launch REALbasic again and the methods described below will be available for your RB applications and the enclosed demo code.
Plugin Functions
The current version has only one function:
• IconToPict(icon as String, bitDepth as Integer, pixelSize as Integer) as Picture
Converts an icon into a Picture so that you can display it within the REALbasic environment.
To see how it is used, look at the method DisplayTheFileIcon in the included REALbasic demo project.
Note: Currently this function only creates a Picture from the Icon's Image, and does not consider the Icon Mask. The Mask is always right behind the Icon Image, in case you want to get that, too.
Note on adding more functionality
If you add more functions to this plugin, please send a copy to me and let me know if you like me to add them to my version on the web, so that others can benefit of the enhancements, too.
If you decide to publish an updated version by yourself, please give me credits (that means: mention where you got the initial code from).
Plugin Programming Information
The plugin code is a Metrowerks CodeWarrior Pro 3 (IDE 3.1) project.
If you have an older CW version that refuses to open the prj file, then create a new and set/enable the following prj options:
• create 68K target (set to 68K linker)
• prj type: Code Resource, File Name "CatalogSearch-Plugin", Creator "SfTg", Type "RBPl", ResType "PL68", ResID "128", Extended Resource, Header Type "Standard"
• C/C++ language settings: Prefix File "MacHeaders.h"
• 68K Processor: 68020 Codegen, Code Model "Smart", Struct Alignm. "PowerPC", 4-Byte Ints, 8-Byte Doubles, MPW C Call. Conv.
• 68K Linker: Link Single Segment, Merge Compiler Glue…, Dead-strip Static Init Code
• Add the files "Plugin Source.cpp", "PluginMain.cpp", "MacOS.lib", "Version Info.rsrc" and a 68K C lib with (4i_8d) in its name to the project.
To compile the project, you also need to have the "Plugin SDK" available, which you can download from RB's website.